import 'package:flutter/material.dart';
import '../const/color.dart';

// 圆角背景视图
class LxBorderRadiusView extends StatelessWidget {
  // 宽、高
  final Size? size;

  // 内容
  final Widget? child;

  // 背景色
  final Color? backgroundColor;

  // 圆角
  final double? radius;

  const LxBorderRadiusView(
    this.size, {
    this.child,
    super.key,
    this.backgroundColor,
    this.radius,
  });

  @override
  Widget build(BuildContext context) {
    return ClipRRect(
      borderRadius: BorderRadius.all(
        Radius.circular(
          radius ?? 4,
        ),
      ),
      child: Container(
        width: size?.width ?? 100,
        height: size?.height ?? 100,
        color: backgroundColor ?? GrayColor.gray4,
        child: child,
      ),
    );
  }
}
